/*
 * acm1243.c
 *
 *  Created on: 11 Apr 2010
 *      Author: xuxu
 */

#include<stdio.h>
#include<string.h>
int main()
{
	char url[12800];
	/*	char pro[128],host[128],port[128],path[128];*/
	int n;
	int con = 1;
	char ch;
	int i, len;
	scanf("%d\n", &n);
	while (n--)
	{
		scanf("%s",url);
		printf("URL #%d\n", con++);
		len = strlen(url);
		printf("Protocol = ");
		i = 0;
		while (i <= len && (ch = url[i]) != ':')
		{
			printf("%c", ch);
			i++;
		}
		printf("\n");
		i += 3;

		printf("Host     = ");
		while (i < len && (ch = url[i]) != '/' && (ch = url[i]) != ':')
		{
			printf("%c", ch);
			i++;
		}
		printf("\n");
		i++;

		printf("Port     = ");
		if (url[i-1] == '/' || i >= len)
		{
			printf("<default>");
		}
		else
		{
			while (i < len && (ch = url[i]) != '/')
			{
				printf("%c", ch);
				i++;
			}
			i++;
		}
		printf("\n");


		printf("Path     = ");
		if (i >= len)
		{
			printf("<default>");
		}
		else
		{
			printf("%s", url + i);
		}
		printf("\n");

		printf("\n");
	}
	return 0;
}
